/*
 * Copyright © 2017 eqxiu.com 北京中网易企秀科技有限公司  All rights reserved.
 */

package cn.hermit.nio.http.server.rest.annotation;

import cn.hermit.nio.http.Http;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author JackGao 高建国
 * @description //TODO 设计说明
 * @date 29/5/2017
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PARAMETER})
public @interface Param {

    String name();

    Http.ParamIn in() default Http.ParamIn.QUERY;

    String description() default "";

    boolean required() default false;


    // ----- If in is any value other than "body" -----


    Http.ParamType type() default Http.ParamType.STRING;

    String format() default "";

    //Sets the ability to pass empty-valued parameters. This is valid only for either query or formData parameters and allows you to send a parameter with a name only or an empty value. Default value is false
    boolean allowEmptyValue() default false;

    //      csv - comma separated values foo,bar.
    //      ssv - space separated values foo bar.
    //     tsv - tab separated values foo\tbar.
    //     pipes - pipe separated values foo|bar.
    //     multi - corresponds to multiple parameter instances instead of multiple values for a single instance foo=bar&foo=baz. This is valid only for parameters in "query" or "formData".
    String collectionFormat() default "csv";

    String _default() default "";

    int maximum() default Integer.MAX_VALUE;

    boolean exclusiveMaximum() default true;

    int minimum() default Integer.MIN_VALUE;

    boolean exclusiveMinimum() default false;

    int maxLength() default Integer.MAX_VALUE;

    int minLength() default Integer.MIN_VALUE;

    String pattern() default "";

    int maxItems() default Integer.MAX_VALUE;

    int minItems() default Integer.MIN_VALUE;

    boolean uniqueItems() default false;

    String _enum() default "";

    int multipleOf() default 0;

    // ----- If in is "body" ------
    String schema() default "";
}
